package lmteam.commentservice;

import org.junit.Test;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.assertEquals;

import lmteam.common.*;

public class CommentServiceProcessorTest
{
		@Test
		public void testComments()
			throws java.rmi.RemoteException
		{
	    lmteam.common.Document testDoc = new lmteam.common.Document();
	  User lemuser = new User("laura", "laura", new
				Role(true,true,true));
	
    User ts = new User("tom", "tom", new
				Role(true, true, true));

		User[] reviewers = {ts, lemuser};

		Comment comment1 = new Comment("accept", "ok"); 
		Comment comment2 = new Comment("reject", "not ok"); 
		Comment[] comments = {comment1, comment2};

			testDoc.setFilename("testFile");
			testDoc.setAuthor("Laura");
			testDoc.setReviewer(reviewers);
			testDoc.setApprover(lemuser);
      testDoc.setData("blah blah test");
			testDoc.setGrade(3);
			testDoc.setComments(comments);

			CommentServiceProcessor csp = new CommentServiceProcessor();
		

		boolean success = csp.provideComment(testDoc);
		assertTrue(success);



			assertTrue(csp.provideComment(testDoc));
		}

		public static void main(String args[])
		{
			try
			{
				CommentServiceProcessorTest cspt = new
					CommentServiceProcessorTest();
				cspt.testComments();
			}
			catch(java.rmi.RemoteException e)
			{
				System.out.println("exception");

			}
		}


}
/*
public static void main(String args[])
{
	try
	{
		CommentServiceProcessorTest cspt = new CommentServiceProcessorTest();
		aspt.testComments();
	}

	catch (java.rmi.RemoteException e)
	{
		System.out.println("Exception occured.");
	}

	System.out.printlm("CommentSertvice Clean Run");

}*/


